
<template>
  <div>
    <el-dialog
      v-model="dialogVisible"
      title="流程模板"
      width="70%"
      :before-close="handleClose"
    >
      <span><Fl_template ref="Fl_template"></Fl_template></span>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="dialogVisible = false">取消</el-button>
          <el-button type="primary" @click="other_handle">确认</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

    <script>
import Fl_template from "@/views/mytable/mytable/Fl_template.vue";
import http from "@/../src/api/http.js";
export default {
  components: { Fl_template },
  data() {
    return {
      dialogVisible: false,
    };
  },
  setup() {},
  destroyed() {},
  mounted() {},
  methods: {
    open_w() {
      //this.dialogVisible = true;
      //console.log(this.$refs.Fl_template.$refs.grid.boxButtons)
    },
    other_handle() {
      //this.dialogVisible = false
      let row = this.$refs.Fl_template.$refs.grid.getSelectRows();
      if (row.length == 0) {
        this.$message.error("请选择流程模版");
        return;
      }
      let ft_id = this.$refs.Fl_template.$refs.grid.getSelectRows()[0].ft_id;
      let racct = this.$store.getters.data().racct;
      let rcntr = this.$store.getters.data().rcntr;
      let turl = "/api/customer_tow/init_flow";
      turl = turl + "?ft_id=" + ft_id + "&racct=" + racct + "&rcntr=" + rcntr;
      this.http.post(turl, {}, true).then((s) => {
        /* if (s.status){//
							this.$message.info(s.Message)
						}else{//失败
							this.openid=x.message;
						} */
        this.$emit("parentCall", ($vue) => {
          console.log($vue);
          $vue.refresh();
          //this.$refs.modelBody.$refs.grid.refresh();
        });
        //this.$refs.Fl_template.
        this.$message.info(s.message);
      });
      // console.log(racct+","+rcntr);

      this.dialogVisible = false;
    },
  },
};
</script>